{include="header"}

<h2 class="text-center">Facturas creadas por <a href="{$fsc->agente->url()}">{$fsc->agente->get_fullname()}</a></h2>

<div class="table-responsive">
   <table class="table table-hover">
      <thead>
         <tr>
            <th></th>
            <th></th>
            <th class="text-left">Código + Cliente</th>
            <th class="text-left">Observaciones</th>
            <th class="text-right">Total</th>
            <th class="text-right">Comisión</th>
            <th class="text-left">%</th>
            <th class="text-right">Fecha</th>
            <th class="text-right">Hora</th>
         </tr>
      </thead>
      {loop="$fsc->resultados"}
      <tr class="clickableRow{if="$value->total<=0"} bg-warning{/if}" href="{$value->url()}">
         <td class="text-center">
            {if condition="$value->pagada"}
            <span class="glyphicon glyphicon-ok" title="La factura está pagada"></span>
            {/if}
         </td>
         <td class="text-center">
            {if condition="$value->idasiento"}
            <span class="glyphicon glyphicon-paperclip" title="La factura tiene vinculado un asiento contable"></span>
            {/if}
         </td>
         <td><a href="{$value->url()}">{$value->codigo}</a> {$value->nombrecliente}</td>
         <td>{$value->observaciones_resume()}</td>
         <td class="text-right">{$fsc->show_precio($value->total, $value->coddivisa)}</td>
         <td class="text-right bg-info">
            {$fsc->show_precio($value->total*$value->porcomision/100, $value->coddivisa)}
         </td>
         <td class="text-left">{$fsc->show_numero($value->porcomision)}</td>
         <td class="text-right">{$value->fecha}</td>
         <td class="text-right">{$value->hora}</td>
      </tr>
      {else}
      <tr class="bg-warning">
         <td></td>
         <td></td>
         <td colspan="7">Ninguna factura encontrada.</td>
      </tr>
      {/loop}
   </table>
</div>

<ul class="pager">
   {if condition="$fsc->anterior_url()!=''"}
   <li class="previous">
      <a href="{$fsc->anterior_url()}">
         <span class="glyphicon glyphicon-chevron-left"></span> &nbsp; Anteriores
      </a>
   </li>
   {/if}
   
   {if condition="$fsc->siguiente_url()!=''"}
   <li class="next">
      <a href="{$fsc->siguiente_url()}">
         Siguientes &nbsp; <span class="glyphicon glyphicon-chevron-right"></span>
      </a>
   </li>
   {/if}
</ul>

{include="footer"}